﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using mmoss.orm;
using mmoss.web;

public partial class Private_Login : PageBase 
{
    protected override void Page_Load(object sender, EventArgs e)
    {
        btnSubmit.Click += new EventHandler(btnSubmit_Click);
    }

    void btnSubmit_Click(object sender, EventArgs e)
    {
        mmoss.orm.User l_user = dbconn.LinqContext.Users.ValidateLogin(
            txtUsername.Text
            , txtPassword.Text
            );
        if (l_user != null)
        {
            LoginUser = l_user;
            //redirect to portal
            Response.Redirect("~/private/POS/poshome.aspx");
        }
        else
        {
            //throw error
        }
    }
}